package controller;

import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;

import multiformat.Calculator;


public class StackController extends JPanel implements ActionListener {

	private static final long serialVersionUID = 1L;

	private Calculator model;
	
	private JButton btnStack;
	
	public StackController(Calculator model) {
		this.model = model;
	
		
		this.btnStack = new JButton("show Stack");
		this.btnStack.setBackground(Color.LIGHT_GRAY);
		
		this.add(btnStack);

		
		//add actionlisteners to buttons
		this.btnStack.addActionListener(this);
		
		this.validate();
		
		this.setVisible(true);
		
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource() == btnStack) {
			model.showView("stack");
		}
	}
}
